package com.shangguigu.exception;

import com.shangguigu.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobaIExcption {
    @ExceptionHandler(value = Exception.class)
    public Result doRest(Exception e){
        log.error("系统异常",e.getMessage());
        return Result.error(e.getMessage());
    }
}
